/**
 * https://leetcode.cn/problems/climbing-stairs/submissions/567376984/
 * 70. 爬楼梯
 * 简单, 李佳颖 2024.09.06
 * 动态规划
 */

 class Solution {
public:
    int climbStairs(int n) {
        vector<int>f(n+1);
        f[0]=f[1]=1;
        for(int i=2;i<=n;i++) {
            f[i]=f[i-1]+f[i-2];
        }
        return f[n];
    }
};

